package com.liwbn.rbac.exception;

import com.liwbn.rbac.support.JsonReInfo;

/**
 * 用于返回异常信息
 * 
 * @author liwb 2016年3月2日 上午11:36:58
 */
public class JsonReException extends RuntimeException {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private Integer code;

    private String message;

    public JsonReException() {
        super();
    }

    public JsonReException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    public JsonReException(String message) {
        super(message);
    }

    public JsonReException(Throwable cause) {
        super(cause);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 获取返回信息
     * 
     * @return
     */
    public JsonReInfo getFailInfo() {
        return new JsonReInfo(code, message);
    }
}
